//
//  PlayerScoreInfo.m
//  iMine
//
//  Created by gaoxiang on 09-3-26.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "PlayerScoreInfo.h"


@implementation PlayerScoreInfo

@synthesize playerName, gameLevel, elapsedTime;

- (id)initWithPlayerName:(NSString *)pname andLevel:(int)level andElapsedTime:(int)second
{
	if (![super init])
		return nil;
	
	playerName = pname;
	gameLevel = level;
	elapsedTime = second;
	
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	[coder encodeObject:playerName forKey:@"playerName"];
	[coder encodeInt:gameLevel forKey:@"gameLevel"];
	[coder encodeInt:elapsedTime forKey:@"elapsedTime"];
}

- (id)initWithCoder:(NSCoder *)coder
{
	[super init];
	playerName = [[coder decodeObjectForKey:@"playerName"] retain];
	gameLevel = [coder decodeIntForKey:@"gameLevel"];
	elapsedTime = [coder decodeIntForKey:@"elapsedTime"];
	
	return self;
}

- (void)dealloc
{
	[playerName release];
	[super dealloc];
}

@end
